package com.clouddot.baipai.ui.adapter;

import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.clouddot.baipai.R;
import com.clouddot.baipai.http.entity.response.getArcticListResponse;
import com.clouddot.baipai.infrastructure.environment.Env;

import org.wxy.sdk.util.imageloader.ImageLoaderUtil;

import java.util.List;

/**
 * Created by wxy on 2018/8/26.
 */

public class V_MainNewsAdapter extends BaseQuickAdapter<getArcticListResponse.ariticInfo, BaseViewHolder> {


    public V_MainNewsAdapter(List<getArcticListResponse.ariticInfo> mDataList) {
        super(R.layout.v_adapter_news_item, mDataList);
    }


    @Override
    protected void convert(BaseViewHolder helper, final getArcticListResponse.ariticInfo item) {

        helper.setText(R.id.title, item.Title);
        helper.setText(R.id.time, item.CreateTime);
        ImageLoaderUtil.getInstance().loadImage(
                "http://" + Env.getAppContext().IP + item.ThumbnailImageUrl, (ImageView) helper.getView(R.id.image));
    }
}
